package com.alks.function.controller.produce;


import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.produce.CutPlanLotRequest;
import com.alks.function.data.request.produce.CutPlanRequest;
import com.alks.function.service.produce.CutPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@ApiRestController("/batch/plan")
@Api(tags ={ "生产部-生产作业-生产标签-轮次生成"})
@Slf4j
public class CutPlanController {

    @Autowired
    private CutPlanService cutPlanService;

    @WebLogger
    @PostMapping("/GeneratePunchingBatch")
    @ApiOperation(value = "生成冲裁批次",tags = "生产部-生产作业-生产标签-轮次生成")
    public ResponseInfo GeneratePunchingBatch(@RequestBody CutPlanRequest request){
        return cutPlanService.GeneratePunchingBatch(request);
    }

    @WebLogger
    @PostMapping("/loadCuttingUndealList")
    @ApiOperation(value = "待安排指令资料",tags = "生产部-生产作业-生产标签-轮次生成")
    public ResponseInfo loadCuttingUndealList(@RequestBody CutPlanLotRequest request){
        return cutPlanService.loadCuttingUndealList(request);
    }

    @WebLogger
    @PostMapping("/loadCuttingDealList")
    @ApiOperation(value = "已安排指令资料",tags = "生产部-生产作业-生产标签-轮次生成")
    public ResponseInfo loadCuttingDealList(@RequestBody CutPlanLotRequest request){
        return cutPlanService.loadCuttingDealList(request);
    }

    @WebLogger
    @PostMapping("/BatchNumberDetails")
    @ApiOperation(value = "批次号码明细",tags = "生产部-生产作业-生产标签-轮次生成")
    public ResponseInfo BatchNumberDetails(@RequestParam String lotNo){
        return cutPlanService.BatchNumberDetails(lotNo);
    }
}
